package com.xsh.gls.service.impl;

import com.xsh.gls.mapper.TermsMapper;
import com.xsh.gls.pojo.Terms;
import com.xsh.gls.service.QuoteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author shkstart
 * @date 2019/1/21 - 8:44
 */
@Service
public class QuoteServiceImpl implements QuoteService {

    @Autowired
    private TermsMapper termsMapper;

    @Override
    public List<Terms> selectAll(String Destination, Integer tranNo) {
        return termsMapper.selectAll(Destination, tranNo);
    }

    @Override
    public Terms getByDTran(String Destination, Integer tranNo) {
        return termsMapper.getByDTran(Destination, tranNo);
    }

    @Override
    public boolean insert(Terms record) {
        boolean flag = false;
        if (termsMapper.insert(record)>0){
            flag = true;
        }
        return flag;
    }

    @Override
    public Terms selectByPrimaryKey(Integer id) {
        return termsMapper.selectByPrimaryKey(id);
    }

    @Override
    public boolean updateByPrimaryKey(Terms record) {
        boolean flag = false;
        if (termsMapper.updateByPrimaryKey(record)>0){
            flag = true;
        }
        return flag;
    }

    @Override
    public boolean deleteByPrimaryKey(Integer id) {
        boolean flag = false;
        if (termsMapper.deleteByPrimaryKey(id)>0){
            flag = true;
        }
        return flag;
    }
}
